<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="shortcut icon" href="/resources/favicon.ico"
	type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="/resources/styles.css">
<title>Homegrown Cuisine - Home</title>
</head>
<body>
	<h1>Welcome to Homegrown Cuisine</h1>
	<div>
		<h3>Administrator</h3>
		<p>
			<a href="./admin">edit</a>
		</p>

		<p>
			<a href="./addUserAccount">registration / login</a>
		</p>
	</div>
	<div style="background: silver;">
		<h3>Recipes</h3>
		<table width="100%">
			<tr>
				<td width="300">Title <a
					href="./?sortableField=Title&direction=Ascending"> <img
						src="../resources/sortup.png" /></a> <a
					href="./?sortableField=Title&direction=Descending"><img
						src="../resources/sortdown.png"></a>
				</td>
				<td width="200">Author <a
					href="./?sortableField=Author&direction=Ascending"><img
						src="../resources/sortup.png" /></a> <a
					href="./?sortableField=Author&direction=Descending"><img
						src="../resources/sortdown.png"></a></td>
				<td width="200">Picture</td>
				<td width="100">Link</td>
			</tr>
			<c:forEach items="${recipes}" var="recipe">
				<tr>
					<td>${recipe.title}</td>
					<td>${recipe.author }</td>
					<td><a href="recipedetail?id=${recipe.key.id}"><img
							src="recipedetail/image?id=${recipe.key.id}" width=150
							height="150" /></a></td>
					<td><a href="recipedetail?id=${recipe.key.id}">Details</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
	<br />
	<!-- This is not yet used. This will be the design according the defined layout
	<div style="border: 1;">
		<table>
			<tr>
				<td valing="top">Top Four Rezepte</td>
				<td><c:forEach items="${recipes}" var="recipe" varStatus="loop">
						<a href="recipedetail?id=${recipe.key.id}"><img
							src="recipedetail/image?id=${recipe.key.id}" width=300
							height="300" /></a>
						${ ((loop.index-1) %2 ) == 0 ? '<br/>' : ''}
					</c:forEach></td>
			</tr>
		</table>
	</div>
	 -->
</body>
</html>